


unsigned int invertir_bits ( unsigned int clave)
{
     unsigned int clave_invertida=0;
     unsigned int i=1;
     unsigned int j=1<<15 ;

     for (j=1<<15 ; j>0  ; j>>=1 )
        {
         if (clave&i) clave_invertida|=j;
         i<<=1;
        }

     return clave_invertida;
}

